﻿<!DOCTYPE html>
<html>
<head>
    <title>CGI</title>
</head>
<body>
    <h1>Our Page</h1>
    <script>
        //01
        //compound assignment operator
        
        var total = 6;
        total += 4;
        console.log(total);

        //shift operator, shift the bits to left or essentially multiplied by 2 for each shift
        //1*2 and multilply by 2 again
        var total = 1;
        total <<= 2;
        console.log(total);

        //division (4/2)
        var total = 4;
        total >>= 1;
        console.log(total);
       

        //02
        //operator precedence, addition comes has high than star equal
        /*
        var total = 6;
        total *= 4 + 1;
        console.log(total);
        */

        //03
        //comma operator,var can declare with comma in single line
        /*
        var total = 99, tax = 9
        console.log(total);
        console.log(tax);

        //confusing comma used with parenthesis, last will appear, not cross browser
        var total = (99, 88, 44);
        console.log(total);
        */
    </script>
</body>
</html>